package com.springbootblog.controller.fontend;

import com.springbootblog.service.fontend.FriendLinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 友情链接部分接口
 * @className AboutController
 * @author camellia
 * @email 805795955@qq.com
 * @date 2024/01/01
 * @version 1.0
 */
@RequestMapping("java")
@RestController
//@CrossOrigin(origins="*",maxAge=3600)
public class FriendLinkController
{
    /**
     * 自动装载（service接口注入）
     */
    @Autowired
    private FriendLinkService friendLinkService;

    /**
     * 友联列表
     * @return
     */
    @GetMapping("friendlink/getFriendLinkList")
    public Map<String,Object> getFriendLinkList()
    {
        Map<String,Object> result = friendLinkService.getFriendLinkList();
        return result;
    }

    /**
     * 友联申请
     * @return
     */
    @PostMapping("friendlink/applyFriendLink")
    public Map<String,Object> applyFriendLink(@RequestBody Map<String, Object> params) throws Exception
    {
        Map<String,Object> result = friendLinkService.applyFriendLink(params);
        return result;
    }
}
